home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.2 Development Libraries / SGI IRIX 6.2 Development Libraries.iso / dist / complib.idb / usr / share / catman / p_man / cat3 / complib / sscal3d.z / sscal3d
Text File  |  1996-03-14  |  7KB  |  133 lines

  1.  
  2.  
  3.  
  4. ssssssssccccaaaallll3333dddd,,,,ddddssssccccaaaallll3333dddd((((3333FFFF))))                                        ssssssssccccaaaallll3333dddd,,,,ddddssssccccaaaallll3333dddd((((3333FFFF))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ssssssssccccaaaallll3333dddd,,,, ddddssssccccaaaallll3333dddd ---- scales 3D real sequence.
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSYYYYSSSS
  12.      _F_o_r_t_r_a_n :
  13.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee ssssssssccccaaaallll3333dddd(((( nnnn1111,,,, nnnn2222,,,, nnnn3333,,,, aaaallllpppphhhhaaaa,,,, aaaarrrrrrrraaaayyyy,,,, llllaaaa1111,,,, llllaaaa2222))))
  14.           iiiinnnntttteeeeggggeeeerrrr            nnnn1111,,,, nnnn2222,,,, nnnn3333,,,, llllaaaa1111,,,, llllaaaa2222
  15.           rrrreeeeaaaallll               aaaallllpppphhhhaaaa,,,, aaaarrrrrrrraaaayyyy((((llllaaaa1111,,,,llllaaaa2222,,,,nnnn3333))))
  16.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee ddddssssccccaaaallll3333dddd(((( nnnn1111,,,, nnnn2222,,,, nnnn3333,,,, aaaallllpppphhhhaaaa,,,, aaaarrrrrrrraaaayyyy,,,, llllddddaaaa))))
  17.           iiiinnnntttteeeeggggeeeerrrr            nnnn1111,,,, nnnn2222,,,, nnnn3333,,,, llllaaaa1111,,,, llllaaaa2222
  18.           rrrreeeeaaaallll****8888             aaaallllpppphhhhaaaa,,,, aaaarrrrrrrraaaayyyy((((llllaaaa1111,,,,llllaaaa2222,,,,nnnn3333))))
  19.  
  20.      _C :
  21.      ####iiiinnnncccclllluuuuddddeeee <<<<fffffffftttt....hhhh>>>>
  22.      iiiinnnntttt ssssssssccccaaaallll3333dddd((((iiiinnnntttt nnnn1111,,,,iiiinnnntttt nnnn2222,,,,iiiinnnntttt nnnn3333,,,, ffffllllooooaaaatttt aaaallllpppphhhhaaaa,,,,
  23.                ffffllllooooaaaatttt ****aaaarrrrrrrraaaayyyy,,,,iiiinnnntttt llllaaaa1111,,,, iiiinnnntttt llllaaaa2222))));;;;
  24.      iiiinnnntttt ddddssssccccaaaallll3333dddd((((iiiinnnntttt nnnn1111,,,,iiiinnnntttt nnnn2222,,,,iiiinnnntttt nnnn3333,,,, ddddoooouuuubbbblllleeee aaaallllpppphhhhaaaa,,,,
  25.                ddddoooouuuubbbblllleeee ****aaaarrrrrrrraaaayyyy,,,,iiiinnnntttt llllaaaa1111,,,, iiiinnnntttt llllaaaa2222))));;;;
  26.  
  27.  
  28. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  29.      ssssssssccccaaaallll3333dddd and ddddssssccccaaaallll3333dddd scale the 3D real sequence of N1xN2xN3 samples.
  30.      The Fourier Transforms are not normalized so the succession Direct-
  31.      Inverse transform scales the input data by a factor equal to the size of
  32.      the transform.  So ssssssssccccaaaallll3333dddd or ddddssssccccaaaallll3333dddd may be used to scale back the
  33.      result.
  34.  
  35. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  36.      NNNN1111 Integer, the first dimension size of the 3D sequence.  Unchanged on
  37.      exit.
  38.  
  39.      NNNN2222 Integer, the second dimension size of the 3D sequence.  Unchanged on
  40.      exit.
  41.  
  42.      NNNN3333 Integer, the thrid dimension size of the 3D sequence.  Unchanged on
  43.      exit.
  44.  
  45.      AAAAllllpppphhhhaaaa scaling floating point value.
  46.  
  47.      AAAARRRRRRRRAAAAYYYY Array containing the samples of the 3D sequence to be transformed.
  48.      On input, the element {i,j,k} of the sequence is stored as A(i,j,k) in
  49.      _F_o_r_t_r_a_n , and A[i+j*la1+k*la1*la2] in _C.
  50.      On exit, the array is overwritten.
  51.  
  52.      LLLLAAAA1111 Integer, first leading dimension: increment between the samples of
  53.      two consecutive 1D sub-sequences (e.g between {i,j+1,k} and {i,j,k} ).
  54.      Unchanged on exit.
  55.  
  56.      LLLLAAAA2222 Integer, second leading dimension: number of the 1D sub-sequence
  57.      between two consecutive 2D sub-sequences (e.g between {i,j,k+1} and
  58.      {i,j,k}).  Unchanged on exit.
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ssssssssccccaaaallll3333dddd,,,,ddddssssccccaaaallll3333dddd((((3333FFFF))))                                        ssssssssccccaaaallll3333dddd,,,,ddddssssccccaaaallll3333dddd((((3333FFFF))))
  71.  
  72.  
  73.  
  74. EEEExxxxaaaammmmpppplllleeee ooooffff CCCCaaaalllllllliiiinnnngggg SSSSeeeeqqqquuuueeeennnncccceeee
  75.      Given a real sequence of size 100x64x125.  We apply successvely the
  76.      Direct FFT, the Inverse FFT, and scale back.  The elements of each
  77.      sequence are stored with increment (stride) 1, the offset between the
  78.      first element of two succesive 1D sub-sequences (first leading dimension)
  79.      is 102, and the number of 1D sub-sequence between two succesive 2D sub-
  80.      sequences (second leading dimension) is 64.
  81.      Note : 102 >= 100+2 , and 64 >= 64.
  82.      _F_o_r_t_r_a_n
  83.           real array(0:102-1,0:64-1,0:125-1), alpha
  84.           real coeff(102+15 + 2*(64+15) + 2*(125+15))
  85.           call scfft3dui( 100, 64, 125, coeff)
  86.           call scfft3du( -1, 100, 64, 125, array, 102, 64, coeff)
  87.           call csfft3du(  1, 100, 64, 125, array, 102, 64, coeff)
  88.           alpha = 1./ real(100*64*125)
  89.           call sscal3d(  100, 64, 125, alpha, array, 102, 64)
  90.  
  91.      _C
  92.           #include <fft.h>
  93.           float array[64*102*125], *coeff;
  94.           coeff = scfft3dui( 100, 64, 125, NULL);
  95.           scfft3du( -1, 100, 64, 125, array, 102, 64, coeff);
  96.           csfft3du(  1, 100, 64, 125, array, 102, 64, coeff);
  97.           alpha = 1./(float)(100*64*125);
  98.           sscal3d(  100, 64, 125, alpha, array, 102, 64);
  99.  
  100.      NNNNOOOOTTTTEEEE____1111 :::: The Direct and Inverse transforms should use opposite signs -
  101.      Which one is used (+1 or -1) for Direct transform is just a matter of
  102.      convention-
  103.  
  104.      NNNNOOOOTTTTEEEE____2222 :::: The Fourier Transforms are not normalized so the succession
  105.      Direct-Inverse transform scales the input data by a factor equal to the
  106.      size of the transform.
  107.  
  108. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  109.      fft, scfft3dui, dzfft3dui, scfft3du, dzfft3du, csfft3du, zdfft3du,
  110.      sprod3du, dprod3du
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.